Skip to content

add TCK tests for auto-closeable beans (@AutoClose)#709

Merged
Ladicek merged 2 commits into
jakartaee:mainfrom
Ladicek:auto-close
May 13, 2026
Merged

add TCK tests for auto-closeable beans (@AutoClose)#709
Ladicek merged 2 commits into
jakartaee:mainfrom
Ladicek:auto-close

Conversation

@Ladicek
Copy link
Copy Markdown
Member

@Ladicek Ladicek commented Apr 17, 2026

Fixes #700

@Ladicek Ladicek requested review from Azquelt and manovotn April 17, 2026 14:58
@Ladicek
Copy link
Copy Markdown
Member Author

Ladicek commented Apr 17, 2026

This is no longer a draft for 2 reasons because:

Other than that, it should be fine. Submitting it now for @manovotn's ongoing work.

@Ladicek
Copy link
Copy Markdown
Member Author

Ladicek commented Apr 20, 2026

Added tests for Producer, but note I didn't run them, because they only make sense for CDI Full.

@Ladicek Ladicek marked this pull request as ready for review April 22, 2026 10:14
@Ladicek
Copy link
Copy Markdown
Member Author

Ladicek commented Apr 22, 2026

Added a test that the call to AutoCloseable.close() during bean destruction is not a business method invocation. This is ready now.

The commits in this PR could be squashed, but don't necessarily have to be; I don't mind.

@Ladicek Ladicek added this to the CDI 5.0 milestone Apr 27, 2026
@Ladicek
Copy link
Copy Markdown
Member Author

Ladicek commented May 4, 2026

Rebased, this can be merged now as there's no SNAPSHOT dependency anymore. Of course, after it's reviewed :-)

@Ladicek
Copy link
Copy Markdown
Member Author

Ladicek commented May 6, 2026

Added one more commit that tests that auto-closeable dependent objects are closed when the containing bean is destroyed.

Copy link
Copy Markdown
Member

@Azquelt Azquelt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍

I don't think we ever actually assert that isAutoClose() returns false anywhere, that may be worth adding.

@Ladicek
Copy link
Copy Markdown
Member Author

Ladicek commented May 13, 2026

Good point, we test both for isAlternative(), isReserve() and isEager(), but not for isAutoClose(). I'll add something.

@Ladicek
Copy link
Copy Markdown
Member Author

Ladicek commented May 13, 2026

Added an extra commit with tests for Bean.isAutoClose() returning false.

@manovotn
Copy link
Copy Markdown
Contributor

I think we can merge this now - @Ladicek, I assume you want to squash those commits first?

@Ladicek
Copy link
Copy Markdown
Member Author

Ladicek commented May 13, 2026

I didn't merge this because of the ongoing discussion in jakartaee/cdi#968, but I guess we can merge anyway, because the spec was already merged too. Let me squash the commits and merge.

@Ladicek Ladicek merged commit d19c0b1 into jakartaee:main May 13, 2026
4 checks passed
@Ladicek Ladicek deleted the auto-close branch May 13, 2026 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create TCK coverage for the @AutoClose feature

3 participants